package com.xwamp.bean;

import java.util.Date;

public class LoginErrorBean {
	private int count;
	private Long exprise;
	private int seconds;
	public LoginErrorBean(){
		
	}
	public LoginErrorBean(int seconds) {
			this.count = 1;
			this.exprise = new Date().getTime()+seconds;
			this.seconds=seconds;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getCount() {
		return this.count;
	}

	public void setExpire(Long value) {
		this.exprise = value;
	}

	public Long getExpire() {
		return this.exprise;
	}

	public void updateCount() {
		this.count++;
		this.exprise = new Date().getTime()+this.seconds;
	}

	public boolean checkLoginable(int maxCount) {
		boolean result = true;
		if (this.count > maxCount && this.exprise < new Date().getTime()) {
			result = false;
		}
		return result;
	}
}
